package abstracttransactions

import (
	"fmt"
	"log"
	"salary/model"
)
/*
 * 更改雇员协会成员身份
 */

type ChangeAffiliationTransaction struct {
	ChangeEmployeeTransaction
	Affiliation
}

type Affiliation interface {
	RecordMembership(employee *model.Employee)
	GetAffiliation() model.Affiliation
}

func (cat *ChangeAffiliationTransaction) Change(employee *model.Employee) {
	cat.RecordMembership(employee)
	af := cat.GetAffiliation()
	employee.SetAffiliation(af)
}

func (cat *ChangeAffiliationTransaction) CalculateDeductions(pc model.PayCheck) {
	err := fmt.Errorf("The method or operation is not implemented.")
	log.Println(err.Error())
}
